
/* -----------------
* brief 
* 1. this is code gen by tools 
* 2. array like [a,b,c] after each field, define the ui html tag in view, 
		a for title, 
		b for show or not , (onlyread is trial feature)
		c for element html tag , currently support : check、radio、select、input、textarea、upload
* 3. XXX
*/
//go:generate legogen -type=MemberCardAccountLog -kv=ModuleName=merchantCard,PrjName=saas_sys_base -dirconf=../../.. ./MemberCardAccountLog.go

/*使用方法一(go generate)：在工程root目录下，执行go generate ./modules/merchantCard/models

使用方法二(legogen)：直接调用生成命令
legogen -type=MemberCardAccountLog -kv=ModuleName=merchantCard,PrjName=saas_sys_base -dirconf=./. ./modules/merchantCard/models/MemberCardAccountLog.go
*/

package merchantCard
import (
	"github.com/mjiulee/lego"
	"saas_sys_base/common"
)

func init() {
	lego.AddBeanToSynList(new(MemberCardAccountLog))
}

/* table: "tb_member_card_account_log"
 * -----------------
*/
type MemberCardAccountLog struct {
	Id        int64  `xorm:"pk" json:",string"`                  // ["id","hide","hidden"]
	IfDel     int `xorm:"default 0"` // ["deleted","hide","hidden"]
	Cdate     string `xorm:"DateTime created"`    // ["create","show","datetime"]
	Udate     string `xorm:"DateTime updated"`    // ["update","show","datetime"]
    // add your custom field here
    //MchCardId int64 `xorm:"" json:",string"`
	UserCardId int64 `xorm:"" json:",string"`  // ["UserCardId","onlyread","input"]

	common.Who `xorm:"extends"` // ["UserCardId","onlyread","input"]

	AddBalance int `xorm:""` // ["余额增值","onlyread","input"]

	AddBonus int `xorm:""` // ["积分增值","onlyread","input"]

	AfterBalance int `xorm:""` // ["结余","onlyread","input"]

	BusinessType BusinessType `xorm:"default 0"` // ["业务类型","onlyread","input"]

	IncomeType IncomeType `xorm:"default 0"` // ["收入/支出","onlyread","input"]

	PayChan PayChan `xorm:"default 0"` // ["支付渠道","onlyread","input"]

	SourceId int64 `xorm:"BigInt  " json:",string"` // ["SourceId","onlyread","input"]

	SourceCode string `xorm:"varchar(255)  "` // ["SourceCode","onlyread","input"]

	Description string `xorm:"varchar(500)  "` // ["描述","onlyread","input"]

	IsFreeze int `xorm:"default 0"` // ["是否冻结","onlyread","input"]
}


type  BusinessType int
const (
	BusinessType_NULL BusinessType = 0
	BusinessType_Recharge BusinessType = 1
	BusinessType_Give BusinessType = 2//赠送
	BusinessType_MchRechargeForUser BusinessType = 3 //商家帮用户充值
	BusinessType_Bonus BusinessType = 5 //积分
	BusinessType_Consume BusinessType = 6//消费
	BusinessType_Forward BusinessType = 7//提现
	BusinessType_Commission BusinessType = 8//佣金
	BusinessType_Conversion BusinessType = 9//兑换
	BusinessType_Praise BusinessType = 10//奖品
	BusinessType_Activity BusinessType = 11//活动
	BusinessType_RodPoint BusinessType = 12//抢积分
	BusinessType_Refund BusinessType = 13//退款
	BusinessType_Turntable BusinessType = 14
	BusinessType_OrderCancel BusinessType = 15
	BusinessType_GroupFaild BusinessType = 16

	 //


)

type IncomeType int
const (
	IncomeType_In IncomeType = 0 //收入
	IncomeType_Out IncomeType = 1 //支出
)

type  PayChan int //支付渠道
const (
	PayChan_WechatPay PayChan = 0 //微信支付
	PayChan_WechatTransfer PayChan = 1 //微信转账
	PayChan_AliPay PayChan = 2 //支付宝支付
	PayChan_AliTransfer PayChan = 3 //支付宝转账
	PayChan_Cash PayChan = 4 //现金支付
)

type CardAddBalance struct {
	AddBalance int `json:"add_balance"` //余额变化值
	GiveBalance int `json:"give_balance"` //赠送余额的值
	AddBonus int `json:"add_bonus"` //余额变化值
	Description string `json:"description"` //备注

	IncomeType IncomeType  `json:"income_type"` //收入还是支出
	BusinessType BusinessType `json:"business_type"` //商家帮用户充值
	PayChan PayChan `json:"pay_chan"` //备注

}